using Microsoft.AspNetCore.Mvc;

namespace WebApplication1_Grpc_Client.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;

        //private readonly MyDate.MyDateClient _date;
        private readonly UserInfo.UserInfoClient _userInfo;

        public WeatherForecastController(ILogger<WeatherForecastController> logger, UserInfo.UserInfoClient userInfo)
        {
            _logger = logger;
            _userInfo = userInfo;
        }

        //[HttpGet(Name = "GetWeatherForecast")]
        //public async Task<string> Get()
        //{
        //    var apply = await _date.GetCurrentDatetimeAsync(new GetCurrentDatetimeRequest());
        //    return apply.ToString();
        //}

        [HttpGet]
        [Route("getUserInfo")]
        public async Task<string> Gets()
        {
            var apply = await _userInfo.GetUserInfoAsync(new GetUserInfoRequest { UserId = "51554177-946D-4331-238A-08DD7B8CDB57" });
            return apply.ToString();
        }
    }
}
